<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>{{$activity['name']}}</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1">
    <!--在iPhone 手机上禁止了把数字转化为拨号链接-->
    <meta content="telephone=no" name="format-detection"/>
    <!--删除默认的苹果工具栏和菜单栏-->
    <meta content="yes" name="apple-mobile-web-app-capable">
    <!-- 网站开启对web app程序的支持，在web app应用下状态条（屏幕顶部条）的颜色，默认值为default（白色），可以定为black（黑色）和black-translucent（灰色半透明）-->
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="/app/{{$activity_template}}/css/index.css" type="text/css"/>
    <link rel="stylesheet" href="/app/{{$activity_template}}/css/animate.min.css" type="text/css"/>
    <style>
        .startPageFooter {
            width: 100%;
        }

        .container:after {
            content: "";
            clear: both;
            display: table;
        }

        .container {
            padding: 10px 0 10px 10px;
        }

        .container .box {
            float: left;
            width: 16.1%;
            border-radius: 50%;
            margin: 0 10px 10px 0;
            overflow: hidden;
            background-color: #CCCCCC;
            -webkit-transition: all 1.0s ease;
            -moz-transition: all 1.0s ease;
            transition: all 1.0s ease;
            transition: all 1.0s ease;
        }
        .layui-m-layer0 .layui-m-layerchild{
            max-height: 100vh;
            overflow: scroll;
        }

    </style>
    <script type="text/javascript" src="/app/{{$activity_template}}/js/jquery.min.js"></script>
    <script type="text/javascript" src="/app/{{$activity_template}}/js/layer/layer.js"></script>
    <script src="//cdn.bootcss.com/js-cookie/latest/js.cookie.min.js"></script>
    @php
        $rule = json_decode($activity['rule'],true);
    @endphp
    <script type="text/javascript">
		$.fn.extend({
			animateCss: function (animationName) {
				var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
				this.addClass('animated ' + animationName).one(animationEnd, function () {
					$(this).removeClass('animated ' + animationName);
				});
			}
		});

		//ajax 请求回来或后台给的数据
		var data = {
			time:{{$rule['basic']['time']}},//抢红包时间
			minNum: {{$rule['basic']['min_num']}},//最低中奖红包数
			speed: 8,//红包降落动画的时间
			bgSrc: '{{$activity['backgroundImg']}}',//游戏背景
		};
		var openid = '{{$openid}}';
		var lastmobile = "";
		var aliUser = Cookies.get('aliuser');
		var default_img = '/app/{{$activity_template}}/img/cashBonus.jpg';
		var prizeData = {};
		if (!data['bgSrc']) {
			data['bgSrc'] = '/app/{{$activity_template}}/img/bg.jpg';
		}

		//增加红包
		var redPacket = {
			//游戏状态值data
			data: {
				time: 30,//抢红包时间
				num: 0,//添加红包计数器
				rNum: 0,//抢的红包数量
				minNum: 30,//最低中奖红包数
				speed: 8,//红包降落动画的时间
				bgSrc: '/app/{{$activity_template}}/img/bg.jpg',//游戏背景
				type: 'left',//有值左飘left,垂直票vertical
				pop: true//是否显示状态栏
			},
			animateEvent: 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend',
			html: {
				//待拆红包
				redPacket: '<div class="redPacketWrap openRedPacket"><div class="redPacket"><div class="redPacket_open" style="background-image:url([logo])"></div></div></div><div style="height:200px"></div><div class="redRainPop"><p class="p1">[name]</p><p class="p2">收到新红包啦</p></div>',
				//没有中奖
				notWinning: '<div class="redRainPop"><div class="popImg"><img src="/app/{{$activity_template}}/img/notWinning.jpg"/></div><p class="p1">[message]</p><p class="p2">[submessage]</p></div>',
				//获得奖品
				getPrize: '<div class="redRainPop"><div class="popImg"><img src="[prizeImage]"/></div><p class="p1">[prizeName]</p></div>',
				//现金红包
				wxcashBonus: '<div class="redRainPop"><div class="popImg"><img src="/app/{{$activity_template}}/img/cashBonus.jpg"/></div><p class="p1">恭喜你获得现金红包</p><p class="p2">[message]</p></div>',
				//卡卷红包
				card: '<div class="redRainPop"><div class="popImg"><img src="[prizeImage]"/></div><p class="p1">[prize_name]</p><p class="p2 mb0 mt0">卡券密码</p><p class="p2 mt0">[prize_code]</p></div>',
				//用户信息
				entityPrize: '<div class="redRainPop"><div class="popImg"><img src="[prizeImage]"/></div><p class="p1">恭喜你获得[prizeName]</p><p class="p2">兑奖地址：[address]</p><p class="p2">请输入联系方式用于领奖</p><input type="text" placeholder="姓名" name="username"/><input type="text"  placeholder="联系电话"  name="phonenum"/></div>',
				entityAddrPrize: '<div class="redRainPop"><div class="popImg"><img src="[prizeImage]"/></div><p class="p1">恭喜你获得[prizeName]</p><p class="p2">请输入联系方式用于领奖</p><input type="text" placeholder="姓名" name="username"/><input type="text"  placeholder="联系电话"  name="phonenum"/><input type="text"  placeholder="邮寄地址"  name="address"/></div>',
				//活动信息
				actDes: '<div class="redRainPop"><h2>活动说明</h2><p class="p1">[description]</p></div>',
				//验证手机
				phoneVerify: '<div class="redRainPop"><p class="p1">请输入联系方式用于验证</p><div class="inputWrap"><input type="text" placeholder="手机" name="tel" value="[mobile]"/></div><div class="inputWrap code"><input type="text"  placeholder="请输入验证码"  name="code"/><a class="getMobileCode">获取</a></div></div>',
				alicashBonus: '<div class="redRainPop"><p class="p1">恭喜你获得现金红包,请填写支付宝账号领取红包</p><input type="text" placeholder="支付宝账号" name="alipay"/></div>'
			},
			//设置data
			setData: function (obj) {
				$.extend(this.data, obj);
			},
			//初始化红包雨
			init: function () {
				this.setData(data);
				//背景图片
				$('body').css({
					background: 'url(' + this.data.bgSrc + ") no-repeat top left",
					backgroundSize: 'cover'
				})
				$('#main').html('');
				redPacket.removeDom();
				window.redPacketAdd = setInterval(redPacket.add.bind(this), 500);
				redPacket.add();
				$('#rTime').html(this.data.time);
				window.redPacketTime = setInterval(function () {
					--this.data.time;
					$('#rTime').html(this.data.time);
				}.bind(this), 1000);
			},
			//当动画执行结束的移除Dom节点
			removeDom: function () {
				$('#main').on(redPacket.animateEvent, 'li', function () {
					$(this).remove();
				});
			},
			add: function () {//添加红包
				var data = this.data;
				//游戏快慢飘得方向切换
				if (data.time <= 0) {
					if (data.minNum <= data.rNum) {
						$('body').append('<div class="shade"></div>');
						var loading = layer.open({type: 2});
						$.post('/redpack_rain/activity/luck_draw', {
							id: '{{$activity['id']}}',
							openid: '{{$openid}}',
							redpack: data.rNum
						}, function (res) {
							layer.close(loading);
							$('.shade').remove();
							if (res.code == 0) {
								if (res.prize.id === 0) {
									layer.open({
										content: redPacket.html.notWinning.replace('[message]', '好可惜没有戳中有奖红包').replace('[submessage]', '下次活动再接再厉，记得参加哦'),
										className: 'animated bounceInDown',
										shadeClose: false,
										anim: false,
										btn: '重新玩一次',
										yes: restartGame
									});
								} else {
									prizeData = res.prize;
									var logo = "/app/{{$activity_template}}/img/cashBonus.jpg";
									var name = "";
									if (res.prize.sponsor) {
										logo = res.prize.sponsor.logo || logo;
										name = res.prize.sponsor.name || '';
									}

									layer.open({
										content: redPacket.html.redPacket.replace('[logo]', logo).replace('[name]', name),
										className: 'animated bounceInDown',
										shadeClose: false,
										anim: false,
									});
								}


							} else {
								layer.open({
									content: redPacket.html.notWinning.replace('[message]', res.message).replace('[submessage]', ''),
									className: 'animated bounceInDown',
									shadeClose: false,
									anim: false,
								});
							}

						});


					} else {
						layer.open({
							content: this.html.notWinning.replace('[message]', '好可惜，手慢了～').replace('[submessage]', ''),
							className: 'animated bounceInDown',
							shadeClose: false,
							anim: false,
							btn: '重新玩一次',
							yes: restartGame
						});
					}
					//$('#topBar').css('display','none');
					clearInterval(redPacketAdd);
					clearInterval(redPacketTime);
				} else if (data.time == 26) {
					this.data.type = 'vertical';
				} else if (data.time == 20) {
					this.data.type = 'left';
				} else if (data.time == 15) {
					this.data.type = 'vertical';
				} else if (data.time == 8) {
					this.data.type = 'left';
				} else if (data.time == 28) {
					this.data.speed = 5;
				} else if (data.time == 26) {
					this.data.speed = 4;
				} else if (data.time == 22) {
					this.data.speed = 3;
				}


				this.data.num++;
				var num = this.data.num;
				var rotate = this.data.type == 'left' ? 30 : 0;
				var win = (parseInt($(".main").css("width"))) - 60;
				var hb = parseInt(Math.random() * (3 - 1) + 1);
				var Wh = parseInt(Math.random() * (120 - 50) + 50);
				var Left = parseInt(Math.random() * (win - 100) + 100);
				var rot = (parseInt(Math.random() * (rotate - 0) - 0)) + "deg";

				$(".main").append("<li class='li" + num + "' ><img src='/app/{{$activity_template}}/img/redPacket.png'></li>");
				$(".li" + num).css({
					"left": Left,
					"animation": "redPack_" + this.data.type + " " + this.data.speed + "s ease-out",
					"-webkit-animation": "redPack_" + this.data.type + " " + this.data.speed + "s ease-out"
				});
				$(".li" + num + " img").css({
					"width": Wh,
					"transform": "rotate(" + rot + ")",
					"-webkit-transform": "rotate(" + rot + ")",
					"-ms-transform": "rotate(" + rot + ")", /* Internet Explorer */
					"-moz-transform": "rotate(" + rot + ")", /* Firefox */
					"-o-transform": "rotate(" + rot + ")" /* Opera */
				});
			},
			//点中红包后删除红包
			del: function (_this) {
				++this.data.rNum;
				var offset = _this.offset();
				var addNumHtml = '<div class="addNum" id="addNum_' + this.data.rNum + '"></div>'
				$('body').append(addNumHtml);
				$('#addNum_' + this.data.rNum).css({
					left: offset.left,
					top: offset.top
				}).addClass('animated slideInUp').one(redPacket.animateEvent, function () {
					$(this).removeClass('animated slideInUp');
					$(this).addClass('animated zoomOut').one(redPacket.animateEvent, function () {
						$(this).remove();
					});
				});

				_this.addClass('animated zoomOut').one(redPacket.animateEvent, function () {
					$(this).remove();
				});
				$('#rNum').html(this.data.rNum);
			}


		}

		//判断平台
		var browser = {
			versions: function () {
				var u = navigator.userAgent, app = navigator.appVersion;
				return {         //移动终端浏览器版本信息
					trident: u.indexOf('Trident') > -1, //IE内核
					presto: u.indexOf('Presto') > -1, //opera内核
					webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
					gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
					mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
					ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
					android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
					iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
					iPad: u.indexOf('iPad') > -1, //是否iPad
					webApp: u.indexOf('Safari') == -1, //是否web应该程序，没有头部与底部
					weixin: u.toLowerCase().match(/MicroMessenger/i) == "micromessenger" ? true : false//判断是否为微信
				};
			}(),
			language: (navigator.browserLanguage || navigator.language).toLowerCase()
		}

		function restartGame() {

			//重新初始化游戏
			layer.closeAll();
			//初始化传入的数据
			data.rNum = 0;
			$('#rNum').html(data.rNum);
			redPacket.setData(data);
			setTimeout(function () {
				redPacket.init();
			}, 10)


		}

		$(document).ready(function () {
			function resizeContainerBox() {
				$('.container .box').each(function (i, v) {
					$(v).css({height: $(v).width()});
				})
			}

			$(window).on('resize', function () {
				resizeContainerBox();
			})
			setTimeout(function () {
				resizeContainerBox();
			}, 200);

			@if($activity['isPause'] == 1)
layer.open({
				content: redPacket.html.notWinning.replace('[message]', '活动还没开始').replace('[submessage]', ''),
				className: 'animated bounceInUp',
				shadeClose: false,
				shade: 'background-color: rgba(0,0,0,.3)',
				anim: false
			});
			@elseif(strtotime($activity['startTime'])>time())
layer.open({
				content: redPacket.html.notWinning.replace('[message]', '活动还没开始').replace('[submessage]', ''),
				className: 'animated bounceInUp',
				shadeClose: false,
				shade: 'background-color: rgba(0,0,0,.3)',
				anim: false
			});
			@elseif(strtotime($activity['endTime'])<time())
layer.open({
				content: redPacket.html.notWinning.replace('[message]', '活动已经结束了').replace('[submessage]', ''),
				className: 'animated bounceInUp',
				shadeClose: false,
				shade: 'background-color: rgba(0,0,0,.3)',
				anim: false
			});
			@else

                @if(empty($openid))
openLoginModal();
            @endif
            @endif
			//禁止页面默认上下滑动
			document.ontouchmove = function (e) {
				if ($(e.target).data('isrolling') == true) {

				} else {
					e.preventDefault();
				}
			}
			//拆红包事件

			function recivePrize(userInfo) {
				var params = {openid: '{{$openid}}', activity_id: '{{$activity['id']}}', prize_id: prizeData.id};
				if (userInfo) {
					params = $.extend(params, userInfo);
				}
				var loding = layer.open({type: 2});
				$.post('/redpack_rain/activity/receive', params, function (res) {
					layer.close(loding);
					if (res.code == 0) {
						$(".layui-m-layerchild").addClass('zoomOutDown').one(redPacket.animateEvent, function () {
							layer.closeAll();
							if (prizeData.type_code == 'coupon') {
								layer.open({
									content: redPacket.html.card.replace('[prize_name]', prizeData.name).replace('[prizeImage]', prizeData.image || default_img).replace('[prize_code]', res.prize.coupon),
									className: 'animated bounceInUp',
									shadeClose: false,
									shade: 'background-color: rgba(0,0,0,.3)',
									anim: false,
									btn: ['再玩一次'],
									yes: restartGame
								});
							}
							if (prizeData.type_code == 'entity') {
								layer.open({
									content: redPacket.html.getPrize.replace('[prizeName]', prizeData.name).replace('[prizeImage]', prizeData.image || default_img),
									className: 'animated bounceInUp',
									shadeClose: false,
									shade: 'background-color: rgba(0,0,0,.3)',
									anim: false,
									btn: ['再玩一次'],
									yes: restartGame
								});
							}
							if (prizeData.type_code == 'wechat' || prizeData.type_code == 'alipay') {
								var message = '已通过公众号/服务号通知发放请查收';
								if (prizeData.type_code == 'alipay') {
									message = '已通过支付宝发放请查收';
								}
								layer.open({
									content: redPacket.html.wxcashBonus.replace('[message]', message),
									className: 'animated bounceInUp',
									shadeClose: false,
									shade: 'background-color: rgba(0,0,0,.3)',
									anim: false,
									btn: ['再玩一次'],
									yes: restartGame
								});
							}

						});
					} else {
						alert(res.message)
					}

				});
			}

			function openLoginModal() {
				layer.open({
					content: redPacket.html.phoneVerify.replace('[mobile]', lastmobile),
					className: 'animated bounceInUp',
					shadeClose: false,
					shade: 'background-color: rgba(0,0,0,.3)',
					anim: false,
					btn: '确认',
					success: function () {
						$('.layui-m-layershade').show();
					},
					yes: function (index) {
						doCheckMobile(index);
					}
				})
			}

			function doCheckMobile(index) {
				var tel = $('input[name="tel"]').val();
				var code = $('input[name="code"]').val();
				if (!tel) {
					alert('请输入手机号');
					return false;
				}
				if (!code) {
					alert('请输入验证码');
					return false;
				}
				lastmobile = tel;
				var loadding = layer.open({type: 2});
				$.post('/utils/check_mobile_code', {mobile: tel, code: code}, function (res) {
					layer.close(loadding);
					if (res.code == 0) {
						openid = tel;
						layer.close(index);
					} else {
						alert(res.message);
					}
				})
			}

			$(document).on('touchstart', '.openRedPacket', function (e) {
				e.preventDefault();
				$(this).find('.redPacket_open').addClass('rotate');
				if (prizeData.type_code == 'entity') {
					setTimeout(function () {
						var content = redPacket.html.entityPrize.replace('[prizeImage]', prizeData.image || default_img).replace('[prizeName]', prizeData.name).replace('[address]', prizeData.exchange_address);
						if (prizeData.exchange_method == 1) {
							content = redPacket.html.entityAddrPrize.replace('[prizeImage]', prizeData.image || default_img).replace('[prizeName]', prizeData.name);
						}
						layer.open({
							content: content,
							className: 'animated bounceInUp',
							shadeClose: false, shade: 'background-color: rgba(0,0,0,.3)',
							anim: false,
							btn: '确认',
							yes: function (index) {
								var name = $('input[name="username"]').val();
								var mobile = $('input[name="phonenum"]').val();
								var address = $('input[name="address"]').val();
								if (!name) {
									alert('请输入姓名');
									return false;
								}
								if (!mobile) {
									alert('请输入联系电话');
									return false;
								}
								if(!(/^1\d{10}$/.test(mobile))){
                                    alert('请输入正确联系电话');
                                    return false;
                                }
								if (prizeData.exchange_method == 1) {
									if (!address) {
										alert('请输入邮寄地址');
										return false;
									}
								}
								recivePrize({name: name, mobile: mobile, address: address});
							}
						});
					}, 2000);

				} else if (prizeData.type_code == 'alipay') {
					setTimeout(function () {
						layer.open({
							content: redPacket.html.alicashBonus,
							className: 'animated bounceInUp',
							shadeClose: false, shade: 'background-color: rgba(0,0,0,.3)',
							anim: false,
							btn: '确认',
							yes: function (index) {
								var alipay = $('input[name="alipay"]').val();
								if (!alipay) {
									alert('请输入支付宝账号领取现金红包');
									return false;
								}
								recivePrize({mobile: alipay});

							}
						});
					}, 2000);
				} else {
					recivePrize();
				}
			})

			$("#main").css({"height": $(document).height() * 1.6, "width": $(document).width()});
			$(document).on('touchstart', '#main li img', function (e) {
				e.preventDefault();
				redPacket.del($(this));
			})
			$(document).on('touchstart', '.startBtn', function (e) {
				if (!openid) {

					openLoginModal();
					return false;
				}

				redPacket.init();
				$('#startPage').addClass('animated lightSpeedOut').one(redPacket.animateEvent, function () {
					layer.closeAll();
					$('#startPage').removeClass('animated lightSpeedOut').hide();
				});
			})
			$(document).on('touchstart', '.actDes,.actRule', function (e) {
				layer.open({
					content: redPacket.html.actDes.replace('[description]', $('#activity_description').html()),
					className: 'animated bounceInUp',
					shadeClose: false, shade: 'background-color: rgba(0,0,0,.3)',
					anim: false,
					btn: '确认',
					success: function () {
						$('.layui-m-layershade').show();
					}
				});
			})
			$(document).on('touchstart', '.getMobileCode', function (e) {
				var self = this;
				if (!$(this).hasClass('disabled')) {
					var tel = $('input[name="tel"]').val();
					if (!tel) {
//                        layer.open({
//                            content: '移动版和PC版不能同时存在同一页面',
//                            fixed:false,
//                            top:0,
//                            btn: '我知道了'
//                        });
						alert('请输入手机号');
						return false;
					}
					$(self).addClass('disabled');
					var timer = setInterval(function () {
						var times = $(self).text();
						if (times == '获取') {
							times = 60;
						}
						times--;
						$(self).html(times);
						if (times == 0) {
							clearInterval(timer);
							$(self).removeClass('disabled');
							$(self).html('获取');
						}
					}, 1000);
					$.post('/utils/send_sms', {mobile: tel}, function (res) {
						if (res.code != 0) {
							alert(res.message || '发送失败');
						}
					})
				}
				return false;
			})
			//倒数计时
			var backward = function () {
				numz--;
				if (numz > 0) {
					$(".backward span").html(numz);
				} else {
					$(".backward").remove();
				}
				setTimeout(backward, 1000)
			}

			var numz = 4;
			backward();

		})
    </script>
    <script type="text/javascript">
        if (/Android/gi.test(navigator.userAgent)) {
            window.addEventListener('resize', function () {
                if (document.activeElement.tagName == 'INPUT' || document.activeElement.tagName == 'TEXTAREA') {
                    window.setTimeout(function () {
                        document.activeElement.scrollIntoViewIfNeeded();
                    }, 0);
                }
            })
        }
    </script>
</head>
<body>
<div id="startPage" data-isrolling="true">

    <div class="startPageFooter">
        {{--<div id="logo" ></div>--}}
        {{--<p class="p1">本次活动由以下提供赞助</p>--}}
        {{--<div class="container p2">--}}
        {{--@foreach($sponsors as $row)--}}
        {{--<div class="box"><img style="width: 100%;" src="{{$row['logo']}}" alt=""></div>--}}
        {{--@endforeach--}}
        {{----}}
        {{--</div>--}}
        <p class="p1">活动由成都华栖云提供</p>
        <a class="startBtn animated wobble">开始</a>
        <p class="p3"><span class="actRule">活动说明</span></p>
    </div>
</div>
<div class="space">
    <div class="stars">
        <div class="star"></div>
        <div class="star pink"></div>
        <div class="star blue"></div>
        <div class="star yellow"></div>
    </div>
</div>
<!-- 顶部状态栏 -->
<div id="topBar">
    <span>剩余<i id="rTime"></i>秒</span>
    <span><i class="rIcon"> </i><i class="rX">x</i><i id="rNum">0</i></span>
</div>

<ul id="main" class="main">
</ul>


<div style="display: none;" id="activity_description">{!! $activity['description'] !!}</div>


@if($from =='wechat')

    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8">
		var shares = {!! $activity['shares'] !!};
		wx.config(<?php echo $wxjs->config(array('onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQZone'), false) ?>);

		wx.ready(function () {
			if (shares['isopen'] && shares['isopen'] == 1) {
				//分享朋友圈
				wx.onMenuShareTimeline({
					title: shares['title'], // 分享标题
					link: '{{$share_url}}' + '?from=wechat', // 分享链接
					imgUrl: shares['icon'], // 分享图标
					success: function () {
						// 用户确认分享后执行的回调函数
					},
					cancel: function () {
						// 用户取消分享后执行的回调函数
					}
				});
				//分享到微信好友
				wx.onMenuShareAppMessage({
					title: shares['title'], // 分享标题
					desc: shares['description'], // 分享描述
					link: '{{$share_url}}' + '?from=wechat', // 分享链接
					imgUrl: shares['icon'], // 分享图标
					type: 'link', // 分享类型,music、video或link，不填默认为link
					dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
					success: function () {
						// 用户确认分享后执行的回调函数
					},
					cancel: function () {
						// 用户取消分享后执行的回调函数
					}
				});
				//分享到qq好友
				wx.onMenuShareQQ({
					title: shares['title'], // 分享标题
					desc: shares['description'], // 分享描述
					link: '{{$share_url}}', // 分享链接
					imgUrl: shares['icon'], // 分享图标
					success: function () {
						// 用户确认分享后执行的回调函数
					},
					cancel: function () {
						// 用户取消分享后执行的回调函数
					}
				});
				//分享到腾讯微博
				wx.onMenuShareWeibo({
					title: shares['title'], // 分享标题
					desc: shares['description'], // 分享描述
					link: '{{$share_url}}', // 分享链接
					imgUrl: shares['icon'], // 分享图标
					success: function () {
						// 用户确认分享后执行的回调函数
					},
					cancel: function () {
						// 用户取消分享后执行的回调函数
					}
				});
				//分享到扣扣空间
				wx.onMenuShareQZone({
					title: shares['title'], // 分享标题
					desc: shares['description'], // 分享描述
					link: '{{$share_url}}', // 分享链接
					imgUrl: shares['icon'], // 分享图标
					success: function () {
						// 用户确认分享后执行的回调函数
					},
					cancel: function () {
						// 用户取消分享后执行的回调函数
					}
				});
			}
		});


    </script>

@endif
</body>
</html>